<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/20
  Time: 9:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>声明方法</title>
</head>
<%!
    public static Double intToDou(int i){
        double d = 0.00;
        d = Double.valueOf(i+".00");
        d = Math.round(d*100)/100;
        return d;
    }
    public  String intToDou2(String i){
        String str = i+".00";
        return str;
    }

%>
<body>
<p>将金额为：10元
    转化为带两位小数的金额：<%=intToDou(10)%>元</p>
</body>
</html>



indexOf(值)   获取某一参数中是否包含这个值，不包含返回-1
10.indexOf(".")  -1




